import request from '@/utils/request'

// 查询商品信息列表
export function listGoods(query) {
  return request({
    url: '/system/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品信息详细
export function getGoods(id) {
  return request({
    url: '/system/goods/' + id,
    method: 'get'
  })
}

// 新增商品信息
export function addGoods(data) {
  return request({
    url: '/system/goods/add',
    method: 'post',
    data: data
  })
}

// 修改商品信息
export function updateGoods(data) {
  return request({
    url: '/system/goods/edit',
    method: 'put',
    data: data
  })
}

// 删除商品信息
export function delGoods(id) {
  return request({
    url: '/system/goods/' + id,
    method: 'delete'
  })
}

//盒子上锁
export function lockBox(data) {
  return request({
    url: '/system/list/sure?goodsId=' + data,
    method: 'post',
  })
}

//盒子排位
export function paiBox(data) {
  return request({
    url: '/system/goods/qualifying?goodsId=' + data,
    method: 'post',
  })
}

//盒子复制
export function copyBox(data) {
  return request({
    url: '/system/goods/copyGoods?goodsId=' + data.goodsId + '&type=' + data.type,
    method: 'post',
  })
}

//添加中奖区间
export function addPrize(data) {
  return request({
    url: '/system/list/interval',
    method: 'post',
    data: data
  })
}

//移除中奖区间
export function delPrize(data) {
  return request({
    url: '/system/list/deleteIntervalList?ids=' + data,
    method: 'post',
   
  })
}

//查询中奖区间
export function listPrize(ids) {
  return request({
    url: '/system/list/showIntervalList?goodsId='+ids,
    method: 'post',
   
  })
}

//修改出奖区间
export function updatePrize(data) {
  return request({
    url: '/system/list/batchUpdateIntervalList',
    method: 'post',
    data: data
  })
}